Skip to content

add SQL parameter values in RequestLogLine so they can be logged/emitted#19067

Merged
clintropolis merged 2 commits intoapache:masterfrom
clintropolis:log-dynamic-parameter-values
Mar 19, 2026
Merged

add SQL parameter values in RequestLogLine so they can be logged/emitted#19067
clintropolis merged 2 commits intoapache:masterfrom
clintropolis:log-dynamic-parameter-values

Conversation

@clintropolis
Copy link
Member

Currently SQL dynamic parameter values are not logged or emitted. This PR adds them to RequestLogLine so they can be logged and emitted with all the other stuff. This is useful for reconstructing the query when troubleshooting errors, since otherwise we only have the SQL with a bunch of ?.

@clintropolis clintropolis force-pushed the log-dynamic-parameter-values branch from 2b3efbc to c177b64 Compare February 28, 2026 00:06

public static RequestLogLine forSql(
String sql,
List<ClientSqlParameter> parameters,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add @Nullable since we explicitly pass null in the above call

}

/**
* Convert parameters list to serde friendly {@link SqlParameter}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Convert parameters list to serde friendly {@link SqlParameter}
* Convert parameters list to serde friendly {@link ClientSqlParameter}

@clintropolis clintropolis merged commit 4dccad7 into apache:master Mar 19, 2026
37 checks passed
@clintropolis clintropolis deleted the log-dynamic-parameter-values branch March 19, 2026 18:09
@github-actions github-actions bot added this to the 37.0.0 milestone Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants